package com.hxrd;

import com.hxrd.collect.CmdCollect;
import com.hxrd.data.Device;

public class TestSsh {

    public static void main(String[] args){
        long currentTime = System.currentTimeMillis();
        CmdCollect collect = new CmdCollect();
        Device dev = new Device();
        dev.setIp("223.75.63.163");
        dev.setUsername("admin");
        dev.setPassword("ruijie@wuhan01");
        dev.setPort(22);
        if(!collect.connect(dev))
        {
            System.out.println("device "+dev.getIp()+" execute failed, it cast time:"+
                    (System.currentTimeMillis()-currentTime)+"ms");
        }
        collect.sendCommand("en\n");
        collect.sendCommand(dev.getPassword()+"\n");
        collect.sendCommand("show ap-config summary\n");
    }
}
